import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/extensions/ex_widget.dart';
import 'package:gourmet/route/index.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/styles.dart';
import 'package:gourmet/utils/svg.dart';

class RecruitRiderController extends GetxController {
  final double navHeight = 44 + Get.mediaQuery.padding.top;
  final double navTop = 44.0;
}

class RecruiteRiderPage extends GetView<RecruitRiderController> {
  const RecruiteRiderPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MediaQuery.removeViewPadding(
      context: context,
      removeTop: true,
      removeLeft: true,
      removeRight: true,
      removeBottom: true,
      child: Material(
        child: Container(
          decoration: BoxDecoration(
            //linear-gradient(180deg, rgba(255, 153, 51, 1) 0%, rgba(255, 153, 51, 1) 0%, rgba(255, 100, 77, 1) 100%, rgba(255, 100, 77, 1) 100%)
            gradient: LinearGradient(
              colors: [
                ColorsUtils.rgba(255, 153, 51, 1),
                ColorsUtils.rgba(255, 153, 51, 1),
                ColorsUtils.rgba(255, 100, 77, 1),
                ColorsUtils.rgba(255, 100, 77, 1),
              ],
            ),
          ),
          child: Column(
            children: [
              Container(
                padding: Get.mediaQuery.padding,
                height: controller.navHeight,
                child: Row(
                  children: [
                    Container(
                      width: 40,
                      height: controller.navTop,
                      alignment: Alignment.center,
                      child: const Icon(
                        CupertinoIcons.chevron_back,
                        size: 20,
                        color: Colors.white,
                      ),
                    ).onTap(Get.back),
                  ],
                ),
              ),
              Expanded(
                child: Column(
                  children: [
                    Container(
                      padding: const EdgeInsets.only(top: 25),
                      alignment: Alignment.center,
                      child: Text(
                        '加入小默配送',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize32,
                        ),
                      ),
                    ),
                    Container(
                      padding: const EdgeInsets.only(top: 10),
                      alignment: Alignment.center,
                      child: Text(
                        '月薪最高可达1.5万元',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize32,
                        ),
                      ),
                    ),
                    Container(
                      margin: insets,
                      padding: const EdgeInsets.symmetric(
                          horizontal: 20, vertical: 30),
                      decoration: BoxDecoration(
                        color: Colors.white,
                        borderRadius: BorderRadius.circular(10),
                      ),
                      child: Column(
                        children: [
                          Row(
                            children: [
                              SvgUtils.assetName('u9646',
                                  width: 56, height: 60),
                              Expanded(
                                child: Padding(
                                  padding: const EdgeInsets.only(left: 15),
                                  child: Column(
                                    children: [
                                      Container(
                                        alignment: Alignment.centerLeft,
                                        child: Text(
                                          '1、收入可观',
                                          style: StylesUtils.customTextStyle(
                                            fontSize: StylesUtils.fontSize17,
                                            color: ColorsUtils.color0000,
                                          ),
                                        ),
                                      ),
                                      Container(
                                        margin: const EdgeInsets.only(top: 8),
                                        alignment: Alignment.centerLeft,
                                        child: Text(
                                          '小默配送为您提供一种全新的赚钱钱选择，利用空闲时间，获得更多收入。',
                                          style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color7979,
                                            lineHeight: 1.5,
                                          ),
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                              ),
                            ],
                          ),
                          Padding(
                            padding: const EdgeInsets.symmetric(vertical: 20),
                            child: Row(
                              children: [
                                Icon(
                                  CupertinoIcons.placemark_fill,
                                  size: 60,
                                  color: HexColor('#0c7af2'),
                                ),
                                Expanded(
                                  child: Padding(
                                    padding: const EdgeInsets.only(left: 15),
                                    child: Column(
                                      children: [
                                        Container(
                                          alignment: Alignment.centerLeft,
                                          child: Text(
                                            '2、地点灵活',
                                            style: StylesUtils.customTextStyle(
                                              fontSize: StylesUtils.fontSize17,
                                              color: ColorsUtils.color0000,
                                            ),
                                          ),
                                        ),
                                        Container(
                                          margin: const EdgeInsets.only(top: 8),
                                          alignment: Alignment.centerLeft,
                                          child: Text(
                                            '小默配送覆盖菲律宾主要城市与中国和地，您可随时就近使用。',
                                            style: StylesUtils.customTextStyle(
                                              color: ColorsUtils.color7979,
                                              lineHeight: 1.5,
                                            ),
                                          ),
                                        ),
                                      ],
                                    ),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Row(
                            children: [
                              Icon(
                                CupertinoIcons.timer_fill,
                                size: 60,
                                color: HexColor('#ff7744'),
                              ),
                              Expanded(
                                child: Padding(
                                  padding: const EdgeInsets.only(left: 15),
                                  child: Column(
                                    children: [
                                      Container(
                                        alignment: Alignment.centerLeft,
                                        child: Text(
                                          '3、时间自由',
                                          style: StylesUtils.customTextStyle(
                                            fontSize: StylesUtils.fontSize17,
                                            color: ColorsUtils.color0000,
                                          ),
                                        ),
                                      ),
                                      Container(
                                        margin: const EdgeInsets.only(top: 8),
                                        alignment: Alignment.centerLeft,
                                        child: Text(
                                          '不必再受繁杂事务约束，加入小默配送，自由分配个人时间，为自己工作。',
                                          style: StylesUtils.customTextStyle(
                                            color: ColorsUtils.color7979,
                                            lineHeight: 1.5,
                                          ),
                                        ),
                                      ),
                                    ],
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ],
                      ),
                    ),
                    Container(
                      margin: const EdgeInsets.only(top: 35),
                      alignment: Alignment.center,
                      child: TextButton(
                        onPressed: () {
                          Get.toNamed(Routes.recruitJoin);
                        },
                        style: ButtonStyle(
                          backgroundColor:
                              const WidgetStatePropertyAll(Colors.white),
                          fixedSize: const WidgetStatePropertyAll(
                            Size(235, 45),
                          ),
                          maximumSize: const WidgetStatePropertyAll(
                            Size(235, 45),
                          ),
                          shape: WidgetStatePropertyAll(
                            RoundedRectangleBorder(
                              borderRadius: BorderRadius.circular(23),
                            ),
                          ),
                          overlayColor:
                              const WidgetStatePropertyAll(Colors.transparent),
                          alignment: Alignment.center,
                        ),
                        child: Text(
                          '我要加入',
                          style: StylesUtils.customTextStyle(
                            fontSize: StylesUtils.fontSize16,
                            color: ColorsUtils.colorFf64,
                          ),
                        ),
                      ),
                    )
                  ],
                ),
              ),
              Container(
                padding: const EdgeInsets.only(top: 10, bottom: 20),
                alignment: Alignment.center,
                child: SizedBox(
                  width: 260,
                  child: Text(
                    '小默外卖不会以面试招聘为由收取费用或押金请勿相信任何收费诈骗',
                    style: StylesUtils.customTextStyle(
                      fontSize: StylesUtils.fontSize13,
                      lineHeight: 1.5,
                    ),
                    textAlign: TextAlign.center,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }

  EdgeInsets get insets {
    return EdgeInsets.only(
        left: (Get.width - 345) / 2, right: (Get.width - 345) / 2, top: 20);
  }
}
